//
//  KeepCallsPayCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/22.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "KeepCallsPayCell.h"

@interface KeepCallsPayCell ()

@property (weak, nonatomic) IBOutlet UIImageView *leftImageView;
@property (weak, nonatomic) IBOutlet UILabel *topLabel;
@property (weak, nonatomic) IBOutlet UILabel *bottomLabel;
@property (weak, nonatomic) IBOutlet UIButton *rightBtn;

@end

@implementation KeepCallsPayCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.rightBtn.userInteractionEnabled = NO;
    
  
    
    self.topLabel.font = MYFONT(14);
    
    self.bottomLabel.font = MYFONT(13);
    
    self.bottomLabel.textColor = darkGray;
    
    self.rightBtn.imageEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10);

}

- (void)setIndex:(NSIndexPath *)index{
    _index = index;
    
    if (index.row == 0) {
        self.topLabel.text = @"支付宝支付";
        self.bottomLabel.text = @"推荐有支付宝账户的用户使用";
        self.leftImageView.image = [UIImage imageNamed:@"payImage06"];
    } else {
        self.topLabel.text = @"微信支付";
        self.bottomLabel.text = @"推荐安装微信5.0以上版本使用";
        self.leftImageView.image = [UIImage imageNamed:@"payImage05"];

    }
    
    
}


- (void)setModel:(GetMoneyInfoModel *)model{
    
    _model = model;
    
    if (self.index.row == 0) {
        
        if ([_model.alipay isEqualToString:@"1"]) {
            self.rightBtn.selected = YES;
        } else {
            self.rightBtn.selected = NO;

        }
        
    } else {
        
        if ([_model.wechatPay isEqualToString:@"1"]) {
            
            self.rightBtn.selected = YES;
            
        } else {
            
            self.rightBtn.selected = NO;
            
        }
        
    }
    
}


- (void)setDetailModel:(GoodsDetailModel *)detailModel{
    
    _detailModel = detailModel;
    
    
    if (self.index.row == 0) {
        
        if ([_detailModel.alipay isEqualToString:@"1"]) {
            self.rightBtn.selected = YES;
        } else {
            self.rightBtn.selected = NO;
            
        }
        
    } else {
        
        if ([_detailModel.wechatPay isEqualToString:@"1"]) {
            
            self.rightBtn.selected = YES;
            
        } else {
            
            self.rightBtn.selected = NO;
            
        }
        
    }
    
}




- (IBAction)rightBtnDidTap:(UIButton *)sender {
    
//    [self.viewController.view endEditing:YES];
//
//
//    sender.selected = !sender.selected;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
